Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
fix #200, #202
Browse files Browse the repository at this point in the history
  • Loading branch information
Cenmrev committed Jan 17, 2019
1 parent a2eab8c commit 34a825c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions V2RayX/AdvancedWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ - (instancetype)initWithWindowNibName:(NSNibName)windowNibName parentController:
return self;
}

- (void)removeObservers {
[self removeObserver:self forKeyPath:@"selectedOutbound"];
[self removeObserver:self forKeyPath:@"selectedRuleSet"];
[self removeObserver:self forKeyPath:@"selectedRule"];
}

- (void)windowDidLoad {
[super windowDidLoad];

Expand Down Expand Up @@ -67,7 +73,7 @@ - (void)windowDidLoad {
forKeyPath:@"selectedRule"
options:NSKeyValueObservingOptionNew
context:nil];
// [self addObserver:self forKeyPath:@"ruleSetNameField.stringValue" options:NSKeyValueObservingOptionNew context:nil];

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(textFieldDidChange:)
name:NSControlTextDidChangeNotification
Expand Down Expand Up @@ -122,11 +128,12 @@ - (IBAction)ok:(id)sender {
}
[self textDidEndEditing:
[[NSNotification alloc] initWithName:NSTextDidEndEditingNotification object:_domainIpTextView userInfo:nil]];

[self removeObservers];
[self.window.sheetParent endSheet:self.window returnCode:NSModalResponseOK];
}

- (IBAction)cancel:(id)sender {
[self removeObservers];
[self.window.sheetParent endSheet:self.window returnCode:NSModalResponseCancel];
}

Expand Down
2 changes: 1 addition & 1 deletion V2RayX/ConfigWindow.xib
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="showAdvancedWindow:" target="-2" id="15k-Xq-IZU"/>
<action selector="showAdvancedWindow:" target="-2" id="1El-Bd-DKf"/>
</connections>
</button>
<button toolTip="Restart V2Ray and connected to the selected server above" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fnz-Bw-lGu">
Expand Down

0 comments on commit 34a825c

Please sign in to comment.